<?php
if ( ! defined('APP-START')) exit('No direct script access allowed');

/**
 * @file		dates.php
 * @desc		The dates library file. It's pretty straight forward as a simple time saver.
 *
 * @package    pasteboard
 * @subpackage library
 * @author     pasteboard team <pb_team@pasteboard.org>
 * @copyright  Copyright (c) 2009, pasteboard group
 * @license    GNU General Public License, http://pasteboard.org/?p=license
 * @link       http://www.pasteboard.org, http://php.net/manual/en/function.date.php
 
 	Copyright (C) 2011  James McCarthy, http://sjamesmccarthy.com

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

class dates extends app
{	

	public function dates()
	{
		/* leave blank if you have no preload actions */
		/* you don't need to extend unless you need methods from app class */
	}
	
	public function make_date($format='DATE_SIMPLE_SLASH')
	{
		switch($format)
		{
			case "TIME_UNIX":							// 1257282398
				return(time());							
				break;
			case "DATE_MYSQL":						 	// 2009-12-25 17:16:32
	 			return(date("Y-m-d H:i:s"));
				break;                                     
			case "DATE_LONG_TS":						// March 10, 2001, 5:16 pm
	 			//date("F j, Y, g:i a");
	 			return(date("F j, Y, g:i a"));
				break;          
			case "DATE_MONTH_LONG":						// March
	 			return(date("F"));
				break;                  				
			case "DATE_MONTH_SHORT":					// Mar
	 			return(date("M"));
				break;                                        
			case "DATE_DAY_LONG":						// Saturday
	 			return(date("l"));
				break;                     
			case "DATE_DAY_SHORT":						// Sat
	 			return(date("D"));
				break;                                           
			case "DATE_SIMPLE_SLASH":					// 03/10/01
	 			return(date("m/d/y"));
				break;             
			case "DATE_SIMPLE_DASH":					// 03-10-01
	 			return(date("m-d-y"));
				break;              
			case "DATE_SIMPLE_DOT":						// 03.10.01
	 			return(date("m.d.y"));
				break;                
			case "TIME_24":								// 17:16:18
	 			return(date("H:i:s"));
				break;                      
			case "TIME_12":								// 5:16 pm
	 			return(date("g:i a"));
				break;                       
			case "TIME_ZONE":							// MST 
	 			return(date("T"));
				break;                         
			case "DATE_FORMATTED_LONG":					// Saturday, March 20, 2009
	 			return(date("l, F m, Y"));
				break;      
			case "DATE_FORMATTED_SHORT":				// Sat Mar 10 2009 
	 			return(date("D M j Y"));
				break;                                 
			case "DATE_YEAR":							// 2009
	 			return(date("Y"));
				break;	
		}
	}
	
	function test()
	{
		echo 'test()';
	}
}

/* End of file */
/* Location: ./libraries/dates.php */